package day1;

import java.util.ArrayList;
import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
public class Arr3 {
    public static void main(String[] args) {
        //泛型
        List<Pet> list=new ArrayList<>();//自动推导
        list.add(new Pet("小花花",100,55));
        list.add(new Pet("大黄",66,65));
        list.add(new Pet("旺财",55,66));
        list.add(new Pet("哮天犬",44,100));
        list.add(new Dog("贾斯汀",100,100,"美利坚流浪狗"));
        Pet pet = list.get(2);
        System.out.println(pet);
        for (Pet o:list) {
            System.out.println(o);
        }
    }
}
